package managedBeans;

import interfacesRemotas.EditoraRemote;

import javax.naming.InitialContext;

import entityBeans.Editora;

public class EditoraMBean {
	private Editora editora = new Editora();

//	@EJB(lookup="EditoraBean")
	private EditoraRemote bean;

	public EditoraMBean() {
		try {
			InitialContext context = new InitialContext();
			bean = (EditoraRemote) context.lookup("categoriaBean");
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}

	public Editora getEditora() {
		return editora;
	}

	public void setEditora(Editora categoria) {
		this.editora = categoria;
	}

	public void cadastrar(Editora editora) {
		try  {
			bean.cadastrar(editora);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
